package de.szut.bomberman.gui.game;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;

import de.szut.bomberman.gui.main.DefaultPanel;
import de.szut.bomberman.gui.mainmenu.MainMenuPanel;
import de.szut.bomberman.main.Controller;
import de.szut.bomberman.main.GameMode;
import de.szut.gui.language.Languages;
import de.szut.gui.language.TranslatableComponent;

public class GamePanel extends DefaultPanel{

	private static final long serialVersionUID = -931846104874336296L;

	private ArrayList<TranslatableComponent> translatableComponents;
	
	public GamePanel(GameMode mode) {
		System.out.println(mode.name());
		translatableComponents = new ArrayList<TranslatableComponent>();
		
		Languages.prepareComponent("game.GamePanel.return", getReturnButton(), translatableComponents);
		getReturnButton().addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent ev) {
				Controller.getInstance().getGuiController().switchPanel(new MainMenuPanel());
			}
		});
		getHeader().setVisible(false);
		
		Controller.getInstance().getGuiController().getLanguages().translateListOfComponents(translatableComponents);
	}
}
